fi =open('xiaofei.csv','r')
result = {}
count = 0
ify = []
for f in fi:

    if count==0:
        ify = f.split(',')
        del ify[0]
        count+=1
    else:
        r = f.split(',')
        re = {}
        for i in range(len(ify)):
            re[ify[i].replace("\n",'')] = r[i+1].replace("\n",'')
            result[r[0]] = re
str = input("请输入要查询的城市和项目(以逗号隔开):\n")

user = str.split(",")
print("您输入的城市是:{}".format(user[0]))
for i in range(len(user)):
    if i>=1:
        print('{0}的消费金额为:{1}'.format(user[i],result[user[0]][user[i]]))